import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from "rxjs";

@Injectable({
  providedIn: 'root'
})
export class CustomerMemberIntegralService {

  // 查询字典
  public dictUrl = '/dict/detail';

  // 会员积分记录list--URL
  public memberIntegralsUrl = '/userIntegralRecord/list';

  // 手动调节(添加)
  public addIntegralUrl = '/userIntegralRecord/save';

  constructor(public httpClient: HttpClient) { }

  /**
   * 会员积分tabledata
   * @param params 
   * @returns 
   */
  public memberIntegralTableData(params: any): Observable<any> {
    return this.httpClient.post(this.memberIntegralsUrl, params);
  }

  /**
   * 字典查询
   * @param id 主键ID
   */
  public dictListData(parentKey: any): Observable<any> {
    let params: any = {
      parentKey: parentKey,
      pageNum: 0,
      pageSize: 0
    };
    return this.httpClient.get(this.dictUrl, { params: params })
  }

  /**
   * 手动调节(添加)
   * @param params 
   * @returns 
   */
  public addIntegralData(params: any): Observable<any> {
    return this.httpClient.post(this.addIntegralUrl, params);
  }
}



